<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>成绩判断</title>
	</head>
	<body>
		<input type="text" placeholder="请输入成绩" id="score" />
		<button onclick="a()">点击</button>
		<p style="color: red;" id="txt">结果</p>
		
		<script>
			function a(){
				var score = document.getElementById("score").value;
				var p = document.getElementById("txt")
				if(score >= 90 && score<= 100 ){
					p.innerHTML = "优秀";
				} else if(score >= 80 && score < 90 ){
					p.innerHTML = "良好";
				} else if(score >= 60 && score < 80 ){
					p.innerHTML = "合格";
				} else if(score > 0 && score < 60 ){
					p.innerHTML = "不及格";
				}
			}
		</script>
	</body>
</html>
